//
//  MainViewController.m
//  Picker Views
//
//  Created by iD Student on 7/1/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "MainViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController
@synthesize theImage;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    appSettings = [NSUserDefaults standardUserDefaults];
    [self setup];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void) setup
{
    theImage = [appSettings integerForKey:@"selectedRow"];
    NSLog([[NSString alloc]initWithFormat:@"Image: %d",theImage]);
    switch(theImage){
        case 3:
            backgroundImage.image = [UIImage imageNamed: [[NSString alloc] initWithFormat:@"rock.jpg"]];
            break;
        case 4:
             backgroundImage.image = [UIImage imageNamed: [[NSString alloc] initWithFormat:@"paper.jpg"]];
            break;
        case 5:
             backgroundImage.image = [UIImage imageNamed: [[NSString alloc] initWithFormat:@"scissors.png"]];
            break;
        default:
            break;
            
    }
}
@end
